<?php

/**
 * AbetSectionCourse filter form base class.
 *
 * @package    sfproject
 * @subpackage filter
 * @author     Your name here
 */
abstract class BaseAbetSectionCourseFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'course_Code'                => new sfWidgetFormPropelChoice(array('model' => 'AbetPlanStudy', 'add_empty' => true, 'key_method' => 'getCode')),
      'course_Name'                => new sfWidgetFormPropelChoice(array('model' => 'AbetPlanStudy', 'add_empty' => true, 'key_method' => 'getName')),
      'stu_t'                      => new sfWidgetFormFilterInput(),
      'total_num_student'          => new sfWidgetFormFilterInput(),
      'total_num_practical_sec'    => new sfWidgetFormFilterInput(),
      'total_num_theory_sec'       => new sfWidgetFormFilterInput(),
      'sec_practical_num'          => new sfWidgetFormFilterInput(),
      'sec_theory_num'             => new sfWidgetFormFilterInput(),
      'assign_stu_practical_sec'   => new sfWidgetFormFilterInput(),
      'unassign_stu_practical_sec' => new sfWidgetFormFilterInput(),
      'assign_stu_theory_sec'      => new sfWidgetFormFilterInput(),
      'unassign_stu_theory_sec'    => new sfWidgetFormFilterInput(),
      'created_at'                 => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'updated_at'                 => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
    ));

    $this->setValidators(array(
      'course_Code'                => new sfValidatorPropelChoice(array('required' => false, 'model' => 'AbetPlanStudy', 'column' => 'code')),
      'course_Name'                => new sfValidatorPropelChoice(array('required' => false, 'model' => 'AbetPlanStudy', 'column' => 'name')),
      'stu_t'                      => new sfValidatorPass(array('required' => false)),
      'total_num_student'          => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'total_num_practical_sec'    => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'total_num_theory_sec'       => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'sec_practical_num'          => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'sec_theory_num'             => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'assign_stu_practical_sec'   => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'unassign_stu_practical_sec' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'assign_stu_theory_sec'      => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'unassign_stu_theory_sec'    => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'created_at'                 => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'updated_at'                 => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
    ));

    $this->widgetSchema->setNameFormat('abet_section_course_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'AbetSectionCourse';
  }

  public function getFields()
  {
    return array(
      'id'                         => 'Number',
      'course_Code'                => 'ForeignKey',
      'course_Name'                => 'ForeignKey',
      'stu_t'                      => 'Text',
      'total_num_student'          => 'Number',
      'total_num_practical_sec'    => 'Number',
      'total_num_theory_sec'       => 'Number',
      'sec_practical_num'          => 'Number',
      'sec_theory_num'             => 'Number',
      'assign_stu_practical_sec'   => 'Number',
      'unassign_stu_practical_sec' => 'Number',
      'assign_stu_theory_sec'      => 'Number',
      'unassign_stu_theory_sec'    => 'Number',
      'created_at'                 => 'Date',
      'updated_at'                 => 'Date',
    );
  }
}
